﻿using IcicleFramework.Components.Behaviors;
using Microsoft.Xna.Framework;

namespace ExampleGame.Components.Behaviors
{
    public class BrickBehavior : BaseBehavior
    {
        private bool launched = false;

        public BrickBehavior() { }

        public BrickBehavior(BrickBehavior old)
            :base(old)
        {
            
        }

        public override void Update(GameTime gameTime)
        {
            if (launched || ActionName == null) return;

            launched = true;
            Parent.FireContinuousActions(Parent.Parent, ActionName);
        }

        public override IBehavior DeepClone()
        {
            return new BrickBehavior(this);
        }
    }
}
